<?php
/**
 * Created by PhpStorm.
 * User: 1
 * Date: 2018/3/23
 * Time: 14:08
 */

namespace app\api\controller\v1;

use app\common\lib\exception\ApiException;
use think\Db;
use app\api\model\Teacher as TeacherModel;

class Teacher extends Common
{

    /**
     * 获取教师详情信息
     * @param id int 教师id *必传
     * @author 王柯 <wangke.email@foxmail.com>
     * @return array|string|\think\response\Json
     */
    public function read(){
        $result = (new TeacherModel)->getTeacher();
        return $result;
    }

    /**
     * @教师端：查询当前教师所发布的课程
     * @教师端：查询当前所有发布的所审核通过的课程 需传status状态为1
     * @param id  int 教师用户id 必传
     * @author 巫玉梅 <1120504614@qq.com>
     */
    public function get_teacher_lessons(){
        $lesson = (new TeacherModel())->all_teacher_lessons();
        return $lesson;
    }

    /**
     * 教师费用提现
     * @param int user_id 用户id *必传
     * @param int bank_account_id 银行账户id *必传
     * @param float total_amount 提现金额 *必传
     * @author 王柯 <wangke.email@foxmail.com>
     * @return array|string|\think\response\Json
     */
    public function teacherCostWithdrawals(){
        $m = new TeacherModel();
        return $m->teacherCostWithdrawals();
    }
}